<include file="Public/Header" />
<style>
    .w360{width: 360px;}
    .introduction{ width:360px;height:100px;resize: none;overflow:hidden;padding: 0px 3px;border: solid 1px #CCCCCC;background: #fff;}
</style>
<table width="100%" height="31px" border="0" cellpadding="0" cellspacing="0" class="left_topbg" id="table2">
    <tr>
        <td height="31">
            <div class="titlebt">
                <if condition="I('get.do')=='add'">
                    添加新闻
                    <else />
                    修改新闻
                </if>
            </div>
        </td>
    </tr>
</table>

<div class="main">
    <div class="form">
        <php>$do = I('get.do');</php>
        <form method='post' id="form_do" name="form_do" enctype="multipart/form-data" action="{:U('News/Lists', 'do='.$do)}">
            <dl>
                <dt> <span class="red">* </span>标题：</dt>
                <dd>
                    <input type="text" name="news_name" class="inp_one w360" value="{$news.news_title}" placeholder="新闻标题" required/>
                </dd>
            </dl>

            <dl>
                <dt> <span class="red">* </span> 所属栏目：</dt>
                <dd>
                    <select id="select0" required>
                        <volist name="category" id="v">
                                <option value="{$v.common_class_id}" {$v.selected}>{$v.common_class_name}</option>
                        </volist>
                    </select>
                    <input type="hidden" name="cid" id="cid" value="{$cate.common_class_id}"/>
                </dd>
            </dl>

            <dl>
                <dt> 摘要：</dt>
                <dd>
                    <textarea class="introduction"   name="introduction" id="introduction">{$news.news_introduction}</textarea>
                </dd>

            </dl>

            <dl>
                <dt> 标题图片：</dt>
                <dd>
                    <input type="text" name="news_image_url" id="news_image_url" class="inp_one w360" value="{$news.news_image}" placeholder="新闻标题图片" />
                    <input type="button" class="btn_blue" value="浏览" onclick="news_image.click()">
                    <span id="news_image_name"></span>
                    <input type="file" name="news_image" id="news_image" style="display:none">
                </dd>
            </dl>

            <!--dl>
                <dt> 内容：</dt>
                <dd>
                    <textarea rows="5" name="news_content" id="news_content" placeholder="新闻内容" style="width:640px;height:360px;" >{$news.news_content}</textarea>
                </dd>
            </dl-->

            <dl>
                <dt> 内容链接：</dt>
                <dd>
                    <input type="text" name="news_link" class="inp_one w360" value="{$news.news_link}" placeholder="新闻外链" />
                </dd>
            </dl>

            <dl>
                <dt> 排序：</dt>
                <dd>
                    <input type="number" class="inp_one" name="news_sort"  value="{$news.news_desc}" placeholder="排序" />
                    <input type="checkbox" name="isposition" value="1" {$news.isposition}>推荐
                </dd>
            </dl>

            <div class="form_b">
                <input type="hidden" name="id" value="{$news.news_id}" />
                <input type="hidden" name="c_url" value="{$c_url}" />
                <input type="submit" class="btn_blue" id="submit" value="提 交">
            </div>
        </form>
    </div>
</div>
<include file="Public/Copyright" />
<!--script charset="utf-8" src="__PUBLIC__/Kindeditor//kindeditor-min.js"></script>
<script charset="utf-8" src="__PUBLIC__/Kindeditor//lang/zh_CN.js"></script-->
<script type="text/javascript">
//    var editor;
//    KindEditor.ready(function(K) {
//        editor = K.create('textarea[name="news_content"]', {
//            themeType : 'simple',
//            resizeType : 1,
//            allowPreviewEmoticons : false,
//            allowImageUpload : false,
//            items : [
//                'source','|', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold', 'italic', 'underline',
//                'removeformat', '|', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
//                'insertunorderedlist', '|', 'image', 'link','|', 'fullscreen']
//        });
//    });

    $('#select0').change(function(){
        var v = parseInt($(this).val());
        if( v > 0 )
            $('#cid').val( v );
    });

    $('#cid').val($('#select0').val());

    $('#news_image').change(function(){
        $("#news_image_name").text(this.value);
    });
</script>
</body>
</html>
